<% layout('/layouts/default.html', {title: '涉密文件日志审计管理', libs: ['dataGrid']}){ %>
<div class="main-content">
    <div class="box box-main">
        <div class="box-body">
            <div class="form-group;" style="border: solid 1px #caced6;border-radius: 10px;height:150px;text-align: center;">
                <label class="control-label" style="margin-top: 20px">${text('来文数量')}：<span id="lwShow"></span></label>
                <div class="control-inline" style="margin-top: 20px">

                    <label class="control-label"> 来文时间</label>
                    <#form:input id="lwStart"  readonly="true" maxlength="20" class=" btn btn-default form-control laydate width-date"

                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="logDate_lte.click()"/>
                    &nbsp;-&nbsp;
                    <#form:input id="lwEnd"  readonly="true" maxlength="20" class="btn btn-default form-control laydate width-date"
                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>

                    <label class="control-label">来文单位</label>
                    <div class=" width-120" style="display: inline-block;text-align: center">
                        <span style="position: relative;top: 10px">
                        <#form:treeselect id="testUser" title="来文单位选择" path="unitCode"
                        url="${ctx}/sd/docDeliverRecord/treeData1"  allowClear="true" checkbox="true"/>
                            </span>
                    </div>


                    <label class="control-label"> 来文密级</label>
                    <div class="control-inline  width-120" style="display: inline-block">
                        <#form:select id="lwSecLvl" dictType="recv_sec_lvl" blankOption="true" class="form-control"/>
                    </div>
                    <label class="control-label"> 紧急程度</label>
                    <div class="control-inline  width-120" style="display: inline-block">
                        <#form:select id="lwEmergLvl" dictType="recv_doc_emerg_lvl" blankOption="true"
                        class="form-control"/>
                    </div>
                    
                    <button class="btn btn-primary btn-sm" onclick="lwfind()">${text('查询')}</button>

                </div>
            </div>
            <div class="form-group;" style="border: solid 1px #caced6;border-radius: 10px;height:150px;text-align: center;">
                <label class="control-label" style="margin-top: 20px">${text('分发数量')}：<span id="lwShow1"></span></label>
                <div class="control-inline" style="margin-top: 20px">

                    <label class="control-label"> 来文时间</label>
                    <#form:input id="fenStart"  readonly="true" maxlength="20" class=" btn btn-default form-control laydate width-date"

                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="logDate_lte.click()"/>
                    &nbsp;-&nbsp;
                    <#form:input id="fenEnd"  readonly="true" maxlength="20" class="btn btn-default form-control laydate width-date"
                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>

                    <label class="control-label">收文单位</label>
                    <div class=" width-120" style="display: inline-block;text-align: center">
                        <span style="position: relative;top: 10px">
                        <#form:treeselect id="testUser1" title="收文单位" path="unitCode"
                        url="${ctx}/sd/docDeliverRecord/getFileUnitTree"  allowClear="true" checkbox="true"/>
                            </span>
                    </div>


                    <label class="control-label"> 收文人</label>
                    <div class="control-inline  width-120" style="display: inline-block">
                          <span style="position: relative;top: 10px">
                        <#form:treeselect id="testUser2" title="用户选择" path="testUser.userCode" labelPath="testUser.userName"
                        url="${ctx}/sys/office/treeData?isLoadUser=true" class="" allowClear="true"/>
                          </span>
                    </div>
                    <label class="control-label"> 还文人</label>
                    <div class="control-inline  width-120" style="display: inline-block">
                          <span style="position: relative;top: 10px">
                        <#form:treeselect id="testUser3" title="用户选择" path="testUser.userCode" labelPath="testUser.userName"
                        url="${ctx}/sys/office/treeData?isLoadUser=true" class="" allowClear="true"/>
                          </span>
                    </div>

                    <button class="btn btn-primary btn-sm" onclick="fenfind()">${text('查询')}</button>

                </div>
            </div>
            <div class="form-group;" style="border: solid 1px #caced6;border-radius: 10px;height:150px;text-align: center;">
                <label class="control-label" style="margin-top: 20px">${text('催领次数')}：<span id="lwShow2"></span></label>
                <label class="control-label" style="margin-top: 20px;margin-left: 20px;">${text('催还次数')}：<span id="lwShow3"></span></label>
                <div class="control-inline" style="margin-top: 20px">

                    <label class="control-label"> 时间范围</label>
                    <#form:input id="urgeStart"  readonly="true" maxlength="20" class=" btn btn-default form-control laydate width-date"

                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="logDate_lte.click()"/>
                    &nbsp;-&nbsp;
                    <#form:input id="urgeEnd"  readonly="true" maxlength="20" class="btn btn-default form-control laydate width-date"
                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>

                    <label class="control-label">单位名称</label>
                    <div class=" width-120" style="display: inline-block;text-align: center">
                        <span style="position: relative;top: 10px">
                         <#form:treeselect id="testUser4" title="收文单位" path="unitCode"
                         url="${ctx}/sd/docDeliverRecord/getFileUnitTree"  allowClear="true"/>
                         </span>
                    </div>
                    <button class="btn btn-primary btn-sm" onclick="take()">${text('查询')}</button>

                </div>
            </div>

            <div class="form-group;" style="border: solid 1px #caced6;border-radius: 10px;height:150px;text-align: center;">
                <label class="control-label" style="margin-top: 20px">${text('销毁文件数量')}：<span id="lwShow4"></span></label>

                <div class="control-inline" style="margin-top: 20px">

                    <label class="control-label"> 时间范围</label>
                    <#form:input id="destroyStart"  readonly="true" maxlength="20" class=" btn btn-default form-control laydate width-date"

                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd" data-done="logDate_lte.click()"/>
                    &nbsp;-&nbsp;
                    <#form:input id="destroyEnd"  readonly="true" maxlength="20" class="btn btn-default form-control laydate width-date"
                    dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>

                    <button class="btn btn-primary btn-sm" onclick="destroy()">${text('查询')}</button>

                </div>
            </div>
        </div>
    </div>
</div>
<% } %>
<script>
    function destroy() {
        var destroyStart=$("#destroyStart").val();
        var destroyEnd=$("#destroyEnd").val();
        if(destroyStart==""&&destroyEnd==""){
            js.layer.msg("必须选择一个",{icon:5})
        }else{
            $("#lwShow4").text('');
            $.ajax({
                url:"${ctx}/sd/docDeliverRecord/destroySelect",
                type:"POST",
                data:{"destroyStart":destroyStart,"destroyEnd":destroyEnd},
                success:function (data) {
                    $("#lwShow4").text(data);
                }
            })
        }
    }

    function take() {
    var urgeStart=$("#urgeStart").val();
    var urgeEnd=$("#urgeEnd").val();
    var testUser2Code=$("#testUser4Code").val();
        if(urgeStart==""&&urgeEnd=="" && testUser2Code==""){
            js.layer.msg("至少选择一个",{icon:5})
        }else{
            $("#lwShow2").text(' ')
            $("#lwShow3").text('')
            $.ajax({
                url:"${ctx}/sd/docDeliverRecord/urgeSelect",
                type:"POST",
                data:{"urgeStart":urgeStart,"urgeEnd":urgeEnd,"recvCode":testUser2Code},
                success:function (data) {
                    $("#lwShow2").text(data.take)
                    $("#lwShow3").text(data.retur)
                }
            })
        }

    }
    function fenfind() {
        var lwStart=$("#fenStart").val()
        var lwEnd=  $("#fenEnd").val()
        var testUser1Code=  $("#testUser1Code").val()
        var testUser2Code=  $("#testUser2Code").val()
        var testUser3Code=  $("#testUser3Code").val()
        if (lwStart=="" && lwEnd=="" && testUser1Code=="" &&testUser2Code=="" &&testUser3Code==""){
            js.layer.msg("至少选择一项",{icon:5})
        }else{
            $("#lwShow1").text('')
            $.ajax({
                url:"${ctx}/sd/docDeliverRecord/recvSelect",
                type:"POST",
                data:{"fenStart":lwStart,"fenEnd":lwEnd,"testUserCode":testUser1Code,"takeUser":testUser2Code,"returnUser":testUser3Code},
                success:function (data) {
                    $("#lwShow1").text(data)
                }
            })
        }
    }
function lwfind() {
    var lwStart=$("#lwStart").val()
    var lwEnd=  $("#lwEnd").val()
    var testUserCode=  $("#testUserCode").val()
    var lwSecLvl=  $("#lwSecLvl").val()
    var lwEmergLvl=  $("#lwEmergLvl").val()
    if (lwStart=="" && lwEmergLvl=="" && lwEnd=="" &&lwSecLvl=="" &&testUserCode==""){
        js.layer.msg("至少选择一项",{icon:5})
    }else{
        $("#lwShow").text('')
        $.ajax({
            url:"${ctx}/sd/docDeliverRecord/recvFind",
            type:"POST",
            data:{"lwStart":lwStart,"lwEnd":lwEnd,"testUserCode":testUserCode,"lwSecLvl":lwSecLvl,"lwEmergLvl":lwEmergLvl},
            success:function (data) {
              $("#lwShow").text(data)
            }
        })
    }
}
</script>